<template>
  <div ref="line"></div>
</template>

<script>
import * as echarts from "echarts";
export default {
  name: "barChart",
  mounted() {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(this.$refs.line);
    // 绘制图表
    myChart.setOption({
      xAxis: {
        show: false,
        type: "category"
      },
      yAxis: {
        show: false
      },
      series: [
        {
          type: "bar",
          data: [5, 28, 35, 26, 15, 40, 66, 5, 50, 20, 40, 22, 44]
        }
      ],
      grid: {
        left: 0,
        top: 10,
        right: 10,
        bottom: 0
      }
    });
  }
};
</script>

<style scoped>
div {
  width: 100%;
  height: 100%;
}
</style>